const express = require('express');
const uuid = require('uuid');
const {
	Msg,
	Paths
} = require('../tools/message.js');
const mysqlObj = require('../model/mysql.class.js');
const router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
	res.send('respond with a resource');
});

var svgCaptcha = require('svg-captcha');

router.get('/captcha', function(req, res) {
	var captcha = svgCaptcha.create({
		width: 100,
		height: 50
	});


	// req.session.captcha = captcha.text;

	// res.type('svg');	  
	res.status(200).send([captcha.data, captcha.text]);

	// res.send(captcha.text)
});


module.exports = router;
